package com.zuxia.action;

import java.util.Map;

import sun.security.util.PropertyExpander.ExpandException;

import com.opensymphony.xwork2.ActionContext;
import com.zuxia.impDao.AdmininfoDAO;
import com.zuxia.iservices.LoginServicesI;
import com.zuxia.po.Admininfo;
/**
 * 用于处理用户登陆的ac
 * @author 谌华勇
 *
 * 2018-11-12上午11:59:36
 */
public class LoginAction extends BaseAction {

	/**
	 * 处理用户登录的业务层
	 */
	private LoginServicesI loginServices;
	
	private String phone;
	private String pwd;
	
	/**
	 * 处理用户登录的方法
	 * @return
	 */
	public String login(){
		try{
			Map<String, Object> mapSession = loginServices.selUserByPhoneAndPwd(phone, pwd);
			if(mapSession.size()>1){
				//存入session中
				super.getSession().setAttribute("session", mapSession);
				return "success";
			}
			else{
				return "input";
			}
		}catch(Exception e){
			return "input";
		}
		
		
	}


	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}


	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public LoginServicesI getLoginServices() {
		return loginServices;
	}

	public void setLoginServices(LoginServicesI loginServices) {
		this.loginServices = loginServices;
	}
	
	
	
}
